﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Register TagPrefix="o" Namespace="Omu.AwesomeWebForms" Assembly="Omu.AwesomeWebForms" %>
<asp:Content ID="indexTitle" ContentPlaceHolderID="TitleContent" runat="server">
    Home Page
</asp:Content>
<asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">
    <div class="sample">
        <h1>
            ASP.net Web-Forms Awesome Controls</h1>
        <p>
            This library contains a rich set of controls that you can use to build highly responsive
            and interactive Ajax-enabled Web applications.
            <br />
            Here's a quick demo:
        </p>
        <form runat="server">
        <h2>
            Lookup with pagination (more results button)</h2>
        <o:Lookup runat="server" ID="loko" GetUrl="~/svc/aja.svc/FruitGet" SearchUrl='~/svc/aja.svc/FruitSearch'
            Value="3" />
        <h2>
            MultiLookup with pagination (more results button)
        </h2>
        <o:MultiLookup runat="server" ID="Fruits" GetMultipleUrl="~/svc/aja.svc/FruitGetMultiple"
            SearchUrl='~/svc/aja.svc/FruitSearch' SelectedUrl="~/svc/aja.svc/FruitSelected"
            Value='["1","2","3"]' Fullscreen="True" ClearButton="true" />
        <h2>
            AjaxDropdown bound to another one by parentId</h2>
        <o:AjaxDropdown runat="server" ID="Categories" Url="~/svc/aja.svc/CategoriesDropdown">
        </o:AjaxDropdown>
        =
        <%
            Fruitsadd.ParentId = Categories.ClientID;
        %>
        <o:AjaxDropdown runat="server" ID="Fruitsadd" Url="~/svc/aja.svc/FruitsDropdown">
        </o:AjaxDropdown>
        <h2>
            AjaxDropdown bound to MultiLookup</h2>
        <o:MultiLookup runat="server" ID="Categories2" GetMultipleUrl="~/svc/aja.svc/CategoryGetMultiple"
            SearchUrl='~/svc/aja.svc/CategorySearch' SelectedUrl="~/svc/aja.svc/CategorySelected"
            Value='["1","2","3"]' />
        <span style="vertical-align: top;">= </span>
        <%
            FruitsFromMulti.ParentId = Categories2.ClientID;
        %>
        <o:AjaxDropdown runat="server" ID="FruitsFromMulti" Url="~/svc/aja.svc/FruitsFromMultiDropdown">
        </o:AjaxDropdown>
        <h2>
            AjaxDropdown bound to 2 dropdowns
        </h2>
        <o:AjaxDropdown runat="server" ID="Cat1" Url="~/svc/aja.svc/CategoriesDropdown" Value="1">
        </o:AjaxDropdown>
        and
        <o:AjaxDropdown runat="server" ID="Cat2" Url="~/svc/aja.svc/CategoriesDropdown" Value="4">
        </o:AjaxDropdown>
        =
        <%
            FruitsFrom2Cat.Data = new Dictionary<string, string>
                                {
                                    {"c1",Cat1.ClientID},
                                    {"c2",Cat2.ClientID}
                                };
        %>
        <o:AjaxDropdown runat="server" ID="FruitsFrom2Cat" Url="~/svc/aja.svc/FruitsFrom2CatDropdown">
        </o:AjaxDropdown>
        <h2>
            AjaxRadioList bound to another one by parentId</h2>
        <o:AjaxRadioList runat="server" ID="CategoriesArl" Url="~/svc/aja.svc/CategoriesDropdown"
            Value="3"></o:AjaxRadioList>
        =
        <%
            FruitsArl.ParentId = CategoriesArl.ClientID;
        %>
        <o:AjaxRadioList runat="server" ID="FruitsArl" Url="~/svc/aja.svc/FruitsList"></o:AjaxRadioList>
        <h2>
            AjaxCheckboxList bound to an AjaxCheckboxList and an AjaxDropdown
        </h2>
        <o:AjaxCheckboxList runat="server" ID="Cat1Acl" Url="~/svc/aja.svc/CategoriesCheckboxList"
            Value="[1]"></o:AjaxCheckboxList>
        and
        <o:AjaxDropdown runat="server" ID="Cat2Add" Url="~/svc/aja.svc/CategoriesDropdown"
            Value="4"></o:AjaxDropdown>
        =
        <%
            FruitsFrom2CatAcl.Data = new Dictionary<string, string>
                                {
                                    {"c1",Cat1Acl.ClientID},
                                    {"c2",Cat2Add.ClientID}
                                };
        %>
        <o:AjaxCheckboxList runat="server" ID="FruitsFrom2CatAcl" Url="~/svc/aja.svc/FruitsFrom2CatCheckboxList">
        </o:AjaxCheckboxList>
        <h2>
            AjaxList bound to a textbox</h2>
        <asp:TextBox runat="server" ID="Name"></asp:TextBox>
        <input type="button" id="bsearch" value="search" />
        <script type="text/javascript">
            function hi(o) {
                alert('hi the id is ' + o);
            }
        </script>
        <% 
            FruitsList.Buttons = new[]
                              {
                                  new AjaxListButton {Content = "hi", JsFunc = "hi"}
                              };
            FruitsList.Data = new Dictionary<string, string> { { "search", Name.ClientID } };
            FruitsList.SearchButton = "bsearch";
        %>
        <o:AjaxList runat="server" ID="FruitsList" SearchUrl='~/svc/aja.svc/FruitSearch' />
        </form>
    </div>
</asp:Content>
